import request from '@/utils/request';

// 获取头饰列表
export function getHeadwearList(params) {
  return request({
    url: '/backend/headwear/getHeadwearList',
    method: 'get',
    params
  });
}

// 获取头饰详情
export function getHeadwearDetail(id) {
  return request({
    url: `/backend/headwear/getHeadwearDetail`,
    method: 'get',
    params: {
      id
    }
  });
}

// 新增头饰
export function createHeadwear(data) {
  return request({
    url: '/backend/headwear/addHeadwear',
    method: 'post',
    data
  });
}

// 更新头饰
export function updateHeadwear(id, data) {
  return request({
    url: `/backend/headwear/updateHeadwear`,
    method: 'put',
    data: {
      id,
      ...data
    }
  });
}

// 删除头饰
export function deleteHeadwear(id) {
  return request({
    url: `/backend/headwear/deleteHeadwear`,
    method: 'delete',
    data: {
      id
    }
  });
}

// 获取头饰分类列表
export function getHeadwearCategories() {
  return request({
    url: '/backend/headwear/getCategoryList',
    method: 'get'
  });
}

// 新增头饰分类
export function createHeadwearCategory(data) {
  return request({
    url: '/backend/headwear/addCategory',
    method: 'post',
    data
  });
}

// 更新头饰分类
export function updateHeadwearCategory(id, data) {
  return request({
    url: `/backend/headwear/category/update/${id}`,
    method: 'put',
    data
  });
}

// 删除头饰分类
export function deleteHeadwearCategory(id) {
  return request({
    url: `/backend/headwear/deleteCategory`,
    method: 'delete',
    data: {
      id
    }
  });
} 